#include <stdio.h>
#include "processbar.h"

void download(funptr ptr)
{
    int target = 1024 * 1024;
    int total = 0;

    while(total <= target)
    {
       //usleep(1000*40);    //模拟下载时间
        total += 1024 * 10;
        int rate = total * 100 / target;
        ptr(rate);
    }
    printf("\n");
}

int main()
{
    download(process_2);
    return 0;
}

void test()
{
    int rate = 0;
    while(rate <= 90)
    {
        process_2(rate);
        rate++;
    }
    printf("\n");
}

